var attachedMouseLayer:MovieClip;
var currentMouseStyle:String;

function initialize(mouseLayer:MovieClip)
{
	if (mouseLayer==null) return;
	attachedMouseLayer=mouseLayer;

	Packages.system.mlf.GateKeeper.invoke(mouseLayer, "attachStyle", new Array("pen"));
	currentMouseStyle="pen";

	var mouseListener:Object=new Object;

	mouseListener.onMouseMove=function()
	{
		if (Packages.system.display.SceneTransition.processFlag) return;
		
		attachedMouseLayer._x=_root._xmouse;
		attachedMouseLayer._y=_root._ymouse;
		if (_root._ymouse>0 && _root._ymouse<200)
		{
			attachedMouseLayer._rotation=10;
		}
		else if (_root._ymouse<300)
		{
			attachedMouseLayer._rotation=20;
		}
		else if (_root._ymouse<400)
		{
			attachedMouseLayer._rotation=30;
		}
		else if (_root._ymouse<500)
		{
			attachedMouseLayer._rotation=40;
		}
		else if (_root._ymouse<600)
		{
			attachedMouseLayer._rotation=50;
		}
	}

	Mouse.addListener(mouseListener);
	Mouse.hide();
}

function changeAttachedMouseStyle(label)
{
	attachedMouseLayer.instance.gotoAndPlay(label);
}

function changeAttachedMouse(name:String)// :MovieClip
{
	if (currentMouseStyle==name) return;
	Packages.system.mlf.GateKeeper.invoke(attachedMouseLayer, "attachStyle", new Array(name));
	currentMouseStyle=name;
	// return attachedMouseLayer;
}